﻿#include "fcgiplus.hpp"
#include "eiendb.hpp"
#include "eiennet.hpp"
#include "eiengd.hpp"
#include "eienexpr.hpp"
#include "eientpl.hpp"
#include "fcgiserv.hpp"
#include <iostream>
using namespace std;
using namespace winux;
using namespace eiendb;
using namespace eiennet;
using namespace eiengd;
using namespace eienexpr;
using namespace eientpl;
using namespace fcgi;


class MVec4 {
    Mixed __data;
public:
    MVec4( float x=0.0f, float y=0.0f, float z=0.0f, float w=0.0f )
    {
        __data.createArray();
        __data[0] = x;
        __data[1] = y;
        __data[2] = z;
        __data[3] = w;
    }
    MVec4( Mixed const& point ) {
        __data.createArray();
        __data[0] = point["x"] || point["r"] || 0.0f;
        __data[1] = point["y"] || point["g"] || 0.0f;
        __data[2] = point["z"] || point["b"] || 0.0f;
        __data[3] = point["w"] || point["a"] || 0.0f;
    }
    inline float x() const { return (float) __data[0]; }
    inline float y() const { return (float) __data[1]; }
    inline float z() const { return (float) __data[2]; }
    inline float w() const { return (float) __data[3]; }
    inline MVec4 xy() const { return MVec4( x(), y() ); }
    inline MVec4 xyz() const { return MVec4( x(), y(), z() ); }

    inline void x( float val ) { __data[0] = val; }
    inline void y( float val ) { __data[1] = val; }
    inline void z( float val ) { __data[2] = val; }
    inline void w( float val ) { __data[3] = val; }
    inline void xyz( MVec4 const& tar ) {
        __data[0] = tar.x();
        __data[1] = tar.y();
        __data[2] = tar.z();
    }
};



int main( int argc, char const * argv[] )
{
#if defined(__GNUC__) && !defined(WIN32) // on linux
    SetLocale::Set("zh_CN.UTF-8");
#endif
    winux::SetLocale __loc__;
    try
    {


MVec4 vec(1,1,1,1);


    }
    catch ( std::exception const & e )
    {
        cout << e.what() << endl;
    }
    catch (...)
    {
        cout << "Unknown error" << endl;
    }
    return 0;
}

